package cn.jxufe.entity;

import javax.persistence.Entity;
import javax.persistence.Table;

import cn.jxufe.bean.EntityID;

@Entity
@Table(name="V_FarmView")
public class FarmView extends EntityID{
	private static final long serialVersionUID = 6710754697122731159L;
	// Farm 表
	private int userId;
	private int seedId;
	private int landId;
	private int curStage;  // 当前种子状态
	private int curStageThroughTime;  // 当前状态已经经过了时间
	private int harvest;  // 当前阶段收成
	private int isInsect;  // 是否生虫
	private int residueSeason;  // 剩余的季度
	
	// CropsGrow 表
	private String stageImage;  // 当前阶段的植物图片
	private String stageTitle;  // 当前阶段标题
	private int stageTime;
	private float insectProb;
	private int imgWidth;
	private int imgHeight;
	private int offsetX;
	private int offsetY;
	private int cropStatus;
	
	// Seed 表
	private String seedName;
	private int xSeasonCrops;
	private int experience;
	private int seasonHarvest;
	private int seedPurchasePrice;
	private int fruitUnitPrice;
	private String landDemand;
	private int seasonGetPoint;
	
	// User 表
	private String userName;
	
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public int getSeedId() {
		return seedId;
	}
	public void setSeedId(int seedId) {
		this.seedId = seedId;
	}
	public int getLandId() {
		return landId;
	}
	public void setLandId(int landId) {
		this.landId = landId;
	}
	public int getCurStage() {
		return curStage;
	}
	public void setCurStage(int curStage) {
		this.curStage = curStage;
	}
	public int getCurStageThroughTime() {
		return curStageThroughTime;
	}
	public void setCurStageThroughTime(int curStageThroughTime) {
		this.curStageThroughTime = curStageThroughTime;
	}
	public int getHarvest() {
		return harvest;
	}
	public void setHarvest(int harvest) {
		this.harvest = harvest;
	}
	public int getIsInsect() {
		return isInsect;
	}
	public void setIsInsect(int isInsect) {
		this.isInsect = isInsect;
	}
	public int getResidueSeason() {
		return residueSeason;
	}
	public void setResidueSeason(int residueSeason) {
		this.residueSeason = residueSeason;
	}
	public String getStageImage() {
		return stageImage;
	}
	public void setStageImage(String stageImage) {
		this.stageImage = stageImage;
	}
	public String getStageTitle() {
		return stageTitle;
	}
	public void setStageTitle(String stageTitle) {
		this.stageTitle = stageTitle;
	}
	public int getStageTime() {
		return stageTime;
	}
	public void setStageTime(int stageTime) {
		this.stageTime = stageTime;
	}
	public float getInsectProb() {
		return insectProb;
	}
	public void setInsectProb(float insectProb) {
		this.insectProb = insectProb;
	}
	public int getImgWidth() {
		return imgWidth;
	}
	public void setImgWidth(int imgWidth) {
		this.imgWidth = imgWidth;
	}
	public int getImgHeight() {
		return imgHeight;
	}
	public void setImgHeight(int imgHeight) {
		this.imgHeight = imgHeight;
	}
	public int getOffsetX() {
		return offsetX;
	}
	public void setOffsetX(int offsetX) {
		this.offsetX = offsetX;
	}
	public int getOffsetY() {
		return offsetY;
	}
	public void setOffsetY(int offsetY) {
		this.offsetY = offsetY;
	}
	public int getCropStatus() {
		return cropStatus;
	}
	public void setCropStatus(int cropStatus) {
		this.cropStatus = cropStatus;
	}
	public String getSeedName() {
		return seedName;
	}
	public void setSeedName(String seedName) {
		this.seedName = seedName;
	}
	public int getxSeasonCrops() {
		return xSeasonCrops;
	}
	public void setxSeasonCrops(int xSeasonCrops) {
		this.xSeasonCrops = xSeasonCrops;
	}
	public int getExperience() {
		return experience;
	}
	public void setExperience(int experience) {
		this.experience = experience;
	}
	public int getSeasonHarvest() {
		return seasonHarvest;
	}
	public void setSeasonHarvest(int seasonHarvest) {
		this.seasonHarvest = seasonHarvest;
	}
	public int getSeedPurchasePrice() {
		return seedPurchasePrice;
	}
	public void setSeedPurchasePrice(int seedPurchasePrice) {
		this.seedPurchasePrice = seedPurchasePrice;
	}
	public int getFruitUnitPrice() {
		return fruitUnitPrice;
	}
	public void setFruitUnitPrice(int fruitUnitPrice) {
		this.fruitUnitPrice = fruitUnitPrice;
	}
	public String getLandDemand() {
		return landDemand;
	}
	public void setLandDemand(String landDemand) {
		this.landDemand = landDemand;
	}
	public int getSeasonGetPoint() {
		return seasonGetPoint;
	}
	public void setSeasonGetPoint(int seasonGetPoint) {
		this.seasonGetPoint = seasonGetPoint;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	public String toTextMessage() {
		return "{" + 
				"userId:" + this.userId +
				",seedId:" + this.seedId +
				",landId:" + this.landId +
				",curStage:" + this.curStage +
				",curStageThroughTime:" + this.curStageThroughTime +
				",harvest:" + this.harvest +
				",isInsect:" + this.isInsect +
				",residueSeason:" + this.residueSeason +
				
				",stageImage: '" + this.stageImage + "'" +
				",stageTitle:'" + this.stageTitle + "'" +
				",stageTime:" + this.stageTime +
				",insectProb:" + this.insectProb +
				",imgWidth:" + this.imgWidth +
				",imgHeight:" + this.imgHeight +
				",offsetX:" + this.offsetX +
				",offsetY:" + this.offsetY +
				",cropStatus:" + this.cropStatus +
				
				",seedName:'" + this.seedName  + "'" +
				",xSeasonCrops:" + this.xSeasonCrops +
				",experience:" + this.experience +
				",seasonHarvest:" + this.seasonHarvest +
				",seedPurchasePrice:" + this.seedPurchasePrice +
				",fruitUnitPrice:" + this.fruitUnitPrice +
				",landDemand:'" + this.landDemand + "'" +
				",seasonGetPoint:" + this.seasonGetPoint +
				
				",userName:'" + this.userName + "'" +
				"}";
	}
	
	public Farm toFarm() {
		Farm farm = new Farm();
		farm.setId(this.getId());
		farm.setUserId(this.userId);
		farm.setSeedId(this.seedId);
		farm.setLandId(this.landId);
		farm.setCurStage(this.curStage);
		farm.setCurStageThroughTime(this.curStageThroughTime);
		farm.setHarvest(this.harvest);
		farm.setIsInsect(this.isInsect);
		farm.setResidueSeason(this.residueSeason);
		return farm;
	}
	
}
